//导入vue-router
import { createRouter, createWebHistory } from 'vue-router'

//导入组件
import LayoutVue from '@/views/Layout.vue';
import AlertRecordsVue from '@/views/alert/AlertRecords.vue'
import AlertRulesVue from '@/views/alert/AlertRules.vue'


//定义路由关系
const routes = [
    {
        path: '/',
        component: LayoutVue,
        redirect: '/alert/records',
        children: [
            {path: '/alert/records',component: AlertRecordsVue},
            {path: '/alert/rules',component: AlertRulesVue}
        ]   
    }

]
//创建路由器
const router = createRouter({
 history: createWebHistory(),
 routes: routes
});
export default router
